package com.csii.mobilebanking.user;

import android.content.Context;

/**
 * 屏幕像素转换工具类
 * 
 * @author Administrator
 * 
 */
public class DisplayXValuesUtil {
	public static int DipToPx(Context context, float dpValue) {
		final float scale = context.getResources().getDisplayMetrics().density;
		return (int) (dpValue * scale + 0.5f);
	}

	public static int PxToDip(Context context, float pxValue) {
		final float scale = context.getResources().getDisplayMetrics().density;
		return (int) (pxValue / scale + 0.5f);
	}
}
